#ifndef BODY_H_INCLUDED
#define BODY_H_INCLUDED

#include "PointFP.h"

struct State {
    // Primary
    PointFP position;
    //Fixed rotation, angularMomentum;

    //Secondary
    PointFP velocity;
    //Fixed spin;

    //Fixed inertia, invInertia;

    void recalculate()
    {
       //velocity = momentum * invInertia;
       //spin = angularMomentum * invInertia;
    }
};

struct Derivative {
    PointFP dPos, dVel;
    //PointFP force;
    //Fixed torque;
};

class Body {
private:
    PointFP acceleration(const State &state, Fixed t);
    Derivative evaluate(const State &initial, Fixed t, Fixed dt, const Derivative &d);
    void integrate(State &state, Fixed t, Fixed dt);

public:
   State data;
   void update(Fixed t, Fixed dt);
};

#endif // BODY_H_INCLUDED
